package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "STOCK_DETAILS", schema = "CRM", catalog = "")
public class StockDetails {
    private long stdeltId;
    private String sName;
    private String sCompany;
    private Long sPrice;
    private Long sNumber;
    private String sSize;
    private String sColor;
    private Stock stock;
    private Long sCaijia;
    @Basic
    @Column(name ="s_caijia")
    public Long getsCaijia() {
        return sCaijia;
    }

    public void setsCaijia(Long sCaijia) {
        this.sCaijia = sCaijia;
    }

    @ManyToOne
    @JoinColumn(name = "KC_ID")
    public Stock getStock() {
        return stock;
    }

    public void setStock(Stock stock) {
        this.stock = stock;
    }

    @Id
    @Column(name = "STDELT_ID", nullable = false, precision = 0)
    @GeneratedValue(generator  =  "seq",strategy  =  GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name  =  "seq",sequenceName  =  "crm",
            initialValue  =  1,allocationSize  =  1)
    public long getStdeltId() {
        return stdeltId;
    }

    public void setStdeltId(long stdeltId) {
        this.stdeltId = stdeltId;
    }

    @Basic
    @Column(name = "S_NAME", nullable = true, length = 255)
    public String getsName() {
        return sName;
    }

    public void setsName(String sName) {
        this.sName = sName;
    }

    @Basic
    @Column(name = "S_COMPANY", nullable = true, length = 255)
    public String getsCompany() {
        return sCompany;
    }

    public void setsCompany(String sCompany) {
        this.sCompany = sCompany;
    }

    @Basic
    @Column(name = "S_PRICE", nullable = true, precision = 2)
    public Long getsPrice() {
        return sPrice;
    }

    public void setsPrice(Long sPrice) {
        this.sPrice = sPrice;
    }

    @Basic
    @Column(name = "S_NUMBER", nullable = true, precision = 0)
    public Long getsNumber() {
        return sNumber;
    }

    public void setsNumber(Long sNumber) {
        this.sNumber = sNumber;
    }

    @Basic
    @Column(name = "S_SIZE", nullable = true, length = 255)
    public String getsSize() {
        return sSize;
    }

    public void setsSize(String sSize) {
        this.sSize = sSize;
    }

    @Basic
    @Column(name = "S_COLOR", nullable = true, length = 255)
    public String getsColor() {
        return sColor;
    }

    public void setsColor(String sColor) {
        this.sColor = sColor;
    }

    @Override
    public String toString() {
        return "StockDetails{" +
                "stdeltId=" + stdeltId +
                ", sName='" + sName + '\'' +
                ", sCompany='" + sCompany + '\'' +
                ", sPrice=" + sPrice +
                ", sNumber=" + sNumber +
                ", sSize='" + sSize + '\'' +
                ", sColor='" + sColor + '\'' +
                ", stock=" + stock +
                ", sCaijia=" + sCaijia +
                '}';
    }
}
